@echo off
echo Starting Snake Game with GPU acceleration...

REM Check if CUDA is available
nvidia-smi >nul 2>&1
if %errorlevel% neq 0 (
    echo WARNING: nvidia-smi not found. GPU may not be available.
    echo Will try to use GPU anyway, fallback to CPU if needed.
    echo.
) else (
    echo GPU Status:
    nvidia-smi --query-gpu=name,memory.total,memory.used --format=csv,noheader,nounits
    echo.
)

echo Compiling project...
call mvn compile -q

echo Starting Snake Game...
echo Press Ctrl+C to stop
echo.

REM Run with Maven exec plugin (simpler approach)
call mvn exec:java -Dexec.mainClass="org.dxy.trigger.SnakeGameWithDQN" -Dexec.args="-Xmx4g -Dorg.nd4j.linalg.factory=org.nd4j.linalg.gpu.CudaNDArrayFactory"

pause